package hello;

import hello.base.HttpResponse;
import hello.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import static hello.base.EasyResponse.RF;


// 使其能处理请求(返回结果为json)
@Controller
@Slf4j
@Api(tags = "用户管理")
public class UserController {


    @PostMapping("/login")
    @ResponseBody
    @ApiOperation("登录接口")
    public HttpResponse login(
            @RequestBody User user)  {
        // ## 填空1 完成此处 当user的account值为xxx，密码为123时
        // 使该接口返回Response code为200，使登录成功。
        boolean isSuccess = false;
        return RF(isSuccess);
    }
}